# Compilers
CXX	= g++ -fPIC
LINK = g++ -fPIC

# Warning flags
CXXWARN_FLAGS = \
        -W -Wall \
        -Wswitch \
        -Wformat \
        -Wchar-subscripts \
        -Wparentheses \
        -Wmultichar \
        -Wtrigraphs \
        -Wpointer-arith \
        -Wcast-align \
        -Wreturn-type \
        -Wno-unused-function

CXXFLAGS  = $(CXXWARN_FLAGS) -fno-strict-aliasing  -DUNIX -O2
LINKFLAGS = 


# OPENCV
OPENCV_INC = $(shell pkg-config --cflags opencv)
OPENCV_LIB = $(shell pkg-config --libs opencv)


# LOCAL
INC = $(OPENCV_INC)
LIB = $(OPENCV_LIB)

TARGET = DFT
OBJS = obj/$(TARGET).o

$(TARGET) : bin/$(TARGET)
bin/$(TARGET) : $(OBJS)
	$(LINK) $(LINKFLAGS) -o $@ $^ $(LIB)
obj/%.o : src/%.cpp
	$(CXX) $(CXXFLAGS) -o $@ -c $^ $(INC)


clean:
	rm -rf bin/* obj/*

